<?php

namespace app\controller;

use app\services\RedisQueue;
use plugin\admin\app\model\NetworkOrder;
use plugin\admin\app\model\RequestLog;
use support\Request;

class OrderController
{

    public function notify(Request $request)
    {
        $data = $request->all();
//        $data['header'] = $request->header();
        RequestLog::create([
            'cmd' => $data['cmd'],
            'body' => json_encode($data, JSON_UNESCAPED_UNICODE),
            'appid' => $data['appId'],
            'message_key' => $data['messageKey']??'',
            'created_at' => time(),
        ]);
       RedisQueue::orderNotify($data);
    }
}